//
//  ViewController.m
//  11-20IOS
//
//  Created by blue on 15-11-20.
//  Copyright (c) 2015年 hyd. All rights reserved.
//

#import "ViewController.h"
#import "inputTableViewController.h"
@interface ViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (strong,nonatomic)UITableView * tableView;
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    self.title = @"我的通讯录";
    self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [self.view addSubview:self.tableView];
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return 5;

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    UITableViewCell * cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:nil];
    cell.textLabel.text = @"电话";
    cell.detailTextLabel.text = @"1324567890";
    cell.imageView.image = [UIImage imageNamed:@"head8.png"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
                          
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
 
    [tableView deselectRowAtIndexPath:indexPath animated:(YES)];
    inputTableViewController * con = [[inputTableViewController alloc]initWithStyle:UITableViewStyleGrouped];
    UITableViewCell  * cell = [tableView cellForRowAtIndexPath:indexPath];
    con.tel = cell.detailTextLabel.text;
    [self.navigationController pushViewController:con animated:YES];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
